Next | Prev | Up | Top | Contents | Index

dslib Functions

In order to use the functions in the library, you include /usr/include/dslib.h in your code, and link with the -lds option so as to link /usr/lib/libds.so. Then the functions summarized in Table 5-7 are available.

dslib Function Summary
Function NamePurposePage
ds_ctostrLook up a string in a table using an integer key.page 95
ds_vtostr Look up a string in a table using an integer key.page 95
dsopenOpen a device special file and allocate a dsreq for use with it.page 92
dscloseFree the dsreq structure and close the device.page 92
doscsireqPerform an operation on a device as specified in a dsreq.page 93
filldsreqSet values in fields of a dsreq structure.page 93
fillg0cmdSet up the dsreq structure for a group 0 SCSI command.page 94
fillg1cmdSet up the dsreq structure for a group 1 SCSI command.page 94
inquiry12Issue an Inquiry command and retrieve information from the device concerning such things as its type.page 96
modeselect15Issue a group 0 Mode Select command to a SCSI device.page 96
modesense1aSend a group 0 Mode Sense command to a device to retrieve a parameter page from the device.page 97
read08Issue a group 0 Read command in disk-drive form.page 98
readextended28Issue a group 1 Read command in disk-drive form.page 98
readcapacity25Issue a Read Capacity command.page 99
requestsense03Issue a Request Sense command and test or probe for the device.page 100
reserveunit16Issue a Reserve Unit command.page 100
releaseunit17Issue a Release Unit command.page 100
senddiagnostic1dIssue a Send Diagnostic command to test if the device or the SCSI bus is online, or run a self-test on the device.page 101
testunitready00Issue a Test Unit Ready command to the SCSI device.page 102
write0aIssue a group 0 Write command to the SCSI device.page 102
writeextended2aIssue an extended Write command to the SCSI device.page 102


Next | Prev | Up | Top | Contents | Index